package fr.labri.macchiato.core.model.utils;

/**
 * A location address
 * 
 * @author Matthieu FOUCAULT
 */
public class Address {

	String street;
	String city;
	String zipCode;
	String country;

	public Address() {
	}

	/**
	 * Creates a new address
	 * 
	 * @param street
	 * @param city
	 * @param zipCode
	 * @param country
	 */
	public Address(String street, String city, String zipCode, String country) {
		this.street = street;
		this.city = city;
		this.zipCode = zipCode;
		this.country = country;
	}

	/**
	 * @return the street
	 */
	public String getStreet() {
		return street;
	}

	/**
	 * Sets the street
	 * 
	 * @param street
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * 
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * Sets the city
	 * 
	 * @param city
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the zip code
	 */
	public String getZipCode() {
		return zipCode;
	}

	/**
	 * Sets the zip code
	 * 
	 * @param zipCode
	 */
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	/**
	 * 
	 * @return the country
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * Sets the country
	 * 
	 * @param country
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof Address))
			return false;
		
		Address address = (Address)object;
		
		return (address.getStreet() == getStreet()) && (address.getCity() == getCity()) &&
				(address.getZipCode() == getZipCode()) && (address.getCountry() == getCountry());
	}
}
